<#include "../base.ftl"/>
<#macro cssfile>
</#macro>

<#macro scriptfile>
</#macro>

<#macro breadcrumb>
    <ul class="breadcrumb">
      <#include "../index-menu.ftl"/>
     <li class="active">保险证书登记</li>
    </ul>
</#macro>

<#macro title>
广大物流云平台
</#macro>

<#macro jsscript>
jQuery(document).ready(function(){
	jQuery("#gridTable").jqGrid({
        url:'${request.contextPath}/list/shipManagement/tsmShippingCer/list.html',
        datatype: "json",
        mtype:"POST",
        height: 400,
        colNames:['证书编号','船员编号','证书代码','证书名','开始日期','结束日期','备注','状态','创建人','创建日期','最后修改人','最后修改时间','文件地址'],
        colModel:[
                    {name:'cerId',jsonmap:'CER_ID',index:'CER_ID',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                    {name:'crewId',jsonmap:'CREW_ID',index:'CREW_ID',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                    {name:'cerCode',jsonmap:'CER_CODE',index:'CER_CODE',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                    {name:'cerName',jsonmap:'CER_NAME',index:'CER_NAME',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                    {name:'startDate',jsonmap:'START_DATE',index:'START_DATE',align:'center',searchoptions : {sopt : [ "eq", "cn" ]},
                        formatter : 'date',
                        formatoptions : {srcformat : 'Y/m/d',newformat : 'Y-m-d'}              
                    },
                    {name:'endDate',jsonmap:'END_DATE',index:'END_DATE',align:'center',searchoptions : {sopt : [ "eq", "cn" ]},
                    	formatter : 'date',
                        formatoptions : {srcformat : 'Y/m/d',newformat : 'Y-m-d'}
                    },
                    {name:'remark',jsonmap:'REMARK',index:'REMARK',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                    {name:'status',jsonmap:'STATUS',index:'STATUS',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                    {name:'createdBy',jsonmap:'CREATED_BY',index:'CREATED_BY',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                    {name:'createdDate',jsonmap:'CREATED_DATE',index:'CREATED_DATE',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]},
                    	formatter : 'date',
                        formatoptions : {srcformat : 'Y/m/d',newformat : 'Y-m-d'},
                        editoptions :  {dataInit: function(element) {
                            $(element).datepicker({changeMonth : true,changeYear : true,dateFormat : 'yy-mm-dd'});
                        }}       
                    },
                    {name:'lastUpdBy',jsonmap:'LAST_UPD_BY',index:'LAST_UPD_BY',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                    {name:'lastUpdDate',jsonmap:'LAST_UPD_DATE',index:'LAST_UPD_DATE',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]},
                    	formatter : 'date',
                        formatoptions : {srcformat : 'Y/m/d',newformat : 'Y-m-d'},
                        editoptions :  {dataInit: function(element) {
                            $(element).datepicker({changeMonth : true,changeYear : true,dateFormat : 'yy-mm-dd'});
                        }}  
                    },
                    {name:'fileUrl',jsonmap:'FILE_URL',index:'FILE_URL',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}
                    }],
        sortname : 'CER_ID',
        sortorder : 'desc',
        viewrecords : true,
        autowidth : true,
        gridview : true,
        rownumbers : true,
//        editurl: '${request.contextPath}/operator.action',
        rowNum : 20,
        rowList : [10,20,30],
             
        jsonReader : {
            page : "page.pageNo", //固定名称
            total : "page.totalPages", //固定名称
            records : "page.totalCount", //固定名称
            root : "page.result", //固定名称
            repeatitems : false, //固定
            id : 'CER_ID'
        },  
        prmNames : {
            rows : "page.pageSize",
            page : "page.pageNo",
            sort : "page.orderBy",
            order : "page.order"
        },
//        loadBeforeSend : function(xhr,settings){
//        //设置访问的list标签
//        settings.data=settings.data+ "&gridKey=/list#TsmShipInsuranceCer";
//        return true;
//        },
        pager : "#gridPager",
        caption : "保险证书登记列表"
        }).navGrid('#gridPager', {
                edit : false,
                add : false, 
                del : false,
                search : true
        }, {
			//edit
			beforeShowForm: function(form) {},
			reloadAfterSubmit : true,
            closeAfterEdit : true, //修改完毕后关闭
            afterComplete : opertaionPrompt
		}, {
			//add
			beforeShowForm: function(form) {},
            reloadAfterSubmit : true,
            closeAfterAdd : true, //新增完毕后关闭
            afterComplete : opertaionPrompt,
            //提交前进行验证
            beforeSubmit :validateSumbit 
		}, {
			//del
            reloadAfterSubmit : true,
            afterComplete : opertaionPrompt
		},{
            //组合查询
            multipleSearch : true
       });

	    //提交前的验证，检验数据，并加入beanName
	    function validateSumbit(postdata, formid){
	        return [true,''];
	    }    
});
</#macro>
<#macro main>
	<table id="gridTable"></table>
	<div id="gridPager"></div>
</#macro>

